/**
  ******************************************************************************
  * @file    main.c
  * @author  野马朝
  * @version V1.0
  * @date    2020-04-06
  * @brief   Default main function.
  ******************************************************************************
*/


#include <stdio.h>
#include "stm32f10x.h"
#include "FreeRTOS.h"
#include "task.h"
#include "freertos.h"
#include "nvic.h"
#include "usart.h"
#include "gpio.h"
#include "w25qxx.h"
#include "fatfs.h"
#include "tim.h"
#include "Steppermotor.h"
#include "fsmc.h"

static void AllPeripheral_Initialization(void)
{
  NVIC_Initialization(NVIC_PriorityGroup_4);    //配置优先级分组为4 方便FreeRTOS管理
  USART_Initialization();                       //串口初始化必须放在IO初始化前 否则上电串口第一个字符会发送0xFF
  // W25QXX_Initialization();                   //SPI FLASH会在挂载FATFS的时候初始化 这里不用初始化
  TIM_Initialization();
  FSMC_Initialization();
  GPIOAll_Initialization();
}

int main(void)
{
  AllPeripheral_Initialization();
	MotorRunParaInitial();
	Initial_Motor(1,M1DIV,73600);
  // Arc_IncMoveCW(5*6400,-5*6400,0,-5*6400,1000);
  FreeRTOS_Initialization();
  vTaskStartScheduler();
}